﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UHUDAL;
using NHibernate.Criterion;

namespace UHUBLL
{
    [Serializable]
    public class BLLBase<T>
    {
        private DALBase<T> dal = new DALBase<T>();
        /// <summary>
        /// 增加一条数据
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public virtual int Create(T entity)
        {
            return dal.Create(entity);
        }
        public virtual int Delete(object id)
        {
            return dal.Delete(id);
        }
        public virtual int Delete(T entity)
        {
            return dal.Delete(entity);
        }
        public virtual T GetModel(object id)
        {
            return dal.GetModel(id);
        }
        public virtual int Update(T entity)
        {
            return dal.Update(entity);
        }
        public virtual IList<T> GetTopList(int top, string where, string order)
        {
            return dal.GetTopList(top, where, order);
        }
        public virtual IList<T> GetTopList(int top, ICriterion criterion, Order order)
        {
            return dal.GetTopList(top, criterion, order);
        }
        public virtual T GetModelByCache(object id)
        {
            return dal.GetModelByCache(id);
        }

    }
}
